home *** CD-ROM | disk | FTP | other *** search
/ Graphics Bonanza / Graphics Bonanza.iso / setup.ins < prev   
Text File  |  1995-11-13  |  5KB  |  174 lines

  1.   { CDROMWIN.INS - CD-ROM Installation File - Windows-platform          }
  2.  
  3.   InstName := 'Express Software';
  4.   Cls;
  5.   StrRet := InstName;
  6.   DoFunc(0);
  7.  
  8. GetFrom:
  9.   DoFunc(5);
  10.   Mssg(6,3,'Enter the Drive letter of your CD-ROM drive.');
  11.   DoFunc(11);
  12.   DoFunc(2);
  13.   CDROMDrive := StrRet;
  14.   BranchEq(IntRet,0,Leaving);
  15.   BranchEq(IntRet,2,GetFrom);
  16.  
  17. GetDrive:
  18.   DoFunc(5);
  19.   Mssg(6,3,'Enter the Drive letter of your harddisk.');
  20.   StrRet := 'C';
  21.   DoFunc(2);
  22.   ToDrive := StrRet;
  23.   BranchEq(IntRet,0,Leaving);
  24.   BranchEq(IntRet,2,GetDrive);
  25.  
  26.   { Example of the directory name on their hard disk }
  27.   {  Should be the same as the directory name stored }
  28.   {  in the HRWCD.CDB file                           }
  29.   ConCat(SysPath,ToDrive,':\EXPGRAPH');
  30.  
  31.   {Make SysPath2 contain the full path to the Batch file on their harddisk}
  32.   StrRet := SysPath;
  33.   DoFunc(6);
  34.   SysPath2 := StrRet;
  35.   ConCat(SysPath2,'START.BAT');
  36.  
  37.   DoFunc(5);
  38.   Mssg(6,3,'You have specified the following:');
  39.   a := '';
  40.   Concat(Uaf,'- CD-ROM is in Drive ',CDROMDrive,':');
  41.   Mssg(6,5,a);
  42.   a := '';
  43.   Concat(a,'- Install Batch File onto Drive ',SysPath);
  44.   Mssg(6,6,a);
  45.   DoFunc(7);
  46.   DoFunc(5);
  47.   BranchEq(IntRet,0,Leaving);
  48.   BranchEq(IntRet,2,GetFrom);
  49.  
  50.   {Check if they have (IntRet*2+100) Kilobytes available on their harddisk}
  51.   IntRet := 1;
  52.   DoFunc(4);
  53.   BranchEq(IntRet,0,Leaving);
  54.   BranchEq(IntRet,2,Leaving);
  55.  
  56.   DoFunc(5);
  57.   Mssg(6,3,'Installing CD-ROM start up batch file now:');
  58.  
  59.   {Make The Directories Here}
  60.   Mssg(5,21,'Creating Directory...');
  61.   ChDir(CDROMDrive,':');
  62.   ChDir('\HR');       {built in directory name on the CD}
  63.   ChDir(ToDrive,':');
  64.   MkDir(SysPath);
  65.   ChDir(SysPath);
  66.  
  67.   Mssg(5,21,'Creating Batch File...');
  68.   StrRet := SysPath2;
  69.   IntRet := CDROMDrive;
  70.   DoFunc(10);
  71.  
  72.   Mssg(5,21,'Creating Program Manager Group...');
  73.   { Creates a Program Manager group, if one doesn't already exist, and }
  74.   { makes that group the top Program Manager Group                     }
  75.   StrRet := 'Express Software - Graphics #1';
  76.   DoFunc(16);
  77.   BranchEq(IntRet,0,Complete);
  78.  
  79.   { Now create an icon and put it in the top Program Manager Group     }
  80.   { Again the '\HR' in the below example is the built-in directory on  }
  81.   { the CD and the 'filename.HW4' can either be replaced with your     }
  82.   { filename or removed.                                               }
  83.   { The second line contains a comma and the name of the item.         }
  84.   StrRet := CDROMDrive;
  85.   Concat(StrRet,':\HR\HRWCD.EXE EXPGRAPH.HW4');
  86.   Concat(StrRet,',','Express Software - Graphics #1');
  87.   DoFunc(17);
  88.   
  89.   {            Only use the section below if you are want              }
  90.   {     to allow the installation process to modify the INI file       }
  91.  
  92.   { A good reason to modify the Initialization file is to give it the  }
  93.   { names of directories where files will be stored                    }
  94.   { For instance if pictures are stored in the directory \PCX on the   }
  95.   { CD, then the only way for HyperWriter to know this intially is by  }
  96.   { having the directory in the INI file.  Since an INI file cannot    }
  97.   { accept a directory without a drive letter and the drive letter of  }
  98.   { the CD-ROM drive won't be known until install time, the process    }
  99.   { below allows you to set this information                           }
  100.  
  101.   { Note again that '\HR' is the built-in directory name on the CD.    }
  102.  
  103.   Copy(CDROMDrive,':\HR\HRWCD.INI');
  104.   DoFunc(22);
  105.   Mssg(5,21,'Modifying Initialization File...');
  106.  
  107.   { The reason for copying the .INI file from the CD first, is that    }
  108.   { this allows any other INI settings to be preset when you press the }
  109.   { CD.                                                                }
  110.  
  111.   { Make StrRet contain the complete path the .INI file                }
  112.   StrRet := SysPath;
  113.   DoFunc(6);
  114.   ConCat(StrRet,'HRWCD.INI');
  115.  
  116.   { Make sure the file is available for Writing.                       }
  117.   { In most cases when copying a file from a CD, the file will be      }
  118.   { read-only.  Warning don't include this if you don't first copy the }
  119.   { file from the CD, because the file won't exist and DoFunc(23) will }
  120.   { return an error.                                                   }
  121.   IntRet := 0;
  122.   DoFunc(23);
  123.   BranchEq(IntRet,0,DoOpen);
  124.   Goto Error;
  125.  
  126. DoOpen:
  127.   { Open the file (or create one if one didn't exist) }
  128.   DoFunc(18);
  129.   BranchEq(IntRet,0,INIOpen);
  130.   Goto Error;
  131.  
  132. INIOpen:
  133.   { Create the entry for the INI using variables at your disposal      }
  134.   StrRet := 'Pictures Path = ';
  135.   Concat(StrRet,CDROMDrive,':\PICTURES');
  136.   { Write the entry out to the .INI file                               }
  137.   DoFunc(19);
  138.   BranchEq(IntRet,0,WroteINI);
  139.   Goto Error;
  140.  
  141. WroteINI:
  142.   { Close the file }
  143.   DoFunc(20);
  144.   BranchEq(IntRet,0,INIClose);
  145.   Goto Error;
  146.  
  147. INIClose:
  148.   { Any other processing would normally go here, but in our case we're }
  149.   { done.                                                              }
  150.  
  151. Complete:
  152.   StrRet := InstName;
  153.   DoFunc(0);
  154.   Mssg(0,0,'Installation Complete');
  155.   Cls;
  156.   Goto Exit;
  157.  
  158. Error:
  159.   StrRet := InstName;
  160.   DoFunc(0);
  161.   Mssg(0,0,'An error has occurred during the installation process.');
  162.   Cls;
  163.   Goto Exit;
  164.  
  165. Leaving:
  166.   StrRet := InstName;
  167.   DoFunc(0);
  168.   Mssg(0,0,'Installation aborted by User');
  169.   Cls;
  170.   Goto Exit;
  171.  
  172. Exit:
  173.  
  174.